package edu.yourl.admin.web;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.spring.injection.annot.SpringBean;

import edu.yourl.admin.presenter.IAdminUserPresenter;
import edu.yourl.domain.User;

public class AdminPage extends WebPage {

	@SpringBean
	private IAdminUserPresenter presenter;

	public AdminPage() {
		add(new ListView<User>("listview",presenter.getUsers()) {
			
			private static final long serialVersionUID = 1L;

			@Override
			protected void populateItem(ListItem<User> item) {
				User user = item.getModelObject();
				item.add(new Label("name",user.getName()));
				item.add(new Label("nickname",user.getNickname()));				
				item.add(new Label("password","******"));
				item.add(new Label("mail",user.getMail()));
			}
		});
	}
	
	
	public void setPresenter(IAdminUserPresenter presenter) {
		this.presenter = presenter;
	}
	
	
}
